package com.ling.team.mainTest;

import com.ling.team.domain.Programmer;
import com.ling.team.service.NameListService;
import com.ling.team.service.TeamService;
import org.junit.Test;

public class TeamServiceTest {
    @Test
    public void getTeam() {
        TeamService teamService = new TeamService();
        teamService.setTotal(5);
        Programmer[] programmers =  teamService.getTeam();
        for (Programmer p: programmers
        ) {
            System.out.println(p);
        }
    }

    @Test
    public void addMember() {
        TeamService teamService = new TeamService();
        teamService.addMember(new NameListService().getEmployee(12));
        Programmer[] programmers =  teamService.getTeam();
        for (Programmer p: programmers
        ) {
            System.out.println(p);
        }
    }

    @Test
    public void removeMember() {
        TeamService teamService = new TeamService();
        teamService.addMember(new NameListService().getEmployee(12));
        teamService.addMember(new NameListService().getEmployee(11));

        teamService.removeMember(2);

        Programmer[] programmers =  teamService.getTeam();
        for (Programmer p: programmers
        ) {
            System.out.println(p);
            System.out.println(p.getMemberId());
        }
    }
}

